import apiClient from '@/api/apiClient';

// /departments/trees
const getDepartmentsList = (data?: any) =>
  apiClient.get({ url: '/departments/trees', params: data });

const createDepartment = (data?: any) => apiClient.post({ url: '/department', data });

const departmentsUsers = (data?: any) => apiClient.post({ url: '/departments_users', data });

const deleteDepartment = (id: number) => apiClient.delete({ url: `/department/${id}` });

const updateDepartment = (id?: number, data?: any) =>
  apiClient.put({ url: `/department/${id}`, data });

export default {
  getDepartmentsList,
  createDepartment,
  deleteDepartment,
  updateDepartment,
  departmentsUsers,
};
